package com.ruoyi.mapper;

import com.ruoyi.entity.po.TPlayerChatRoom;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author chenhainan
 * @since 2024-12-09 20:36
 */
@Mapper
public interface TPlayerChatRoomMapper {
    int deleteByPrimaryKey(@Param("id") Integer id);

    int deleteByPrimaryKeys(@Param("ids") Integer[] ids);

    int insert(@Param("record") TPlayerChatRoom record);

    int insertSelective(@Param("record") TPlayerChatRoom record);

    TPlayerChatRoom selectByPrimaryKey(@Param("id") Integer id);

    int updateByPrimaryKeySelective(@Param("record") TPlayerChatRoom record);

    int updateByPrimaryKey(@Param("record") TPlayerChatRoom record);

    List<TPlayerChatRoom> selectChatRommList(@Param("record") TPlayerChatRoom record);

    @Select("select * from t_player_chat_room where player_name = #{playerName} ")
    TPlayerChatRoom selectByPlayerName(@Param("playerName") String playerName);

    @Select("update t_player_chat_room set room_name = #{roomName}  where player_name = #{playerName} ")
    void updateRoomNameByPlayerName(@Param("playerName")String playerName,@Param("roomName") String roomName);

    @Select("select * from t_player_chat_room where player_id = #{playerId} ")
    TPlayerChatRoom selectByPlayerId(@Param("playerId") Integer playerId);
}